package com.minimalist.common.entity.tc.entity.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 停车订单表 实体类。
 *
 * @author 11987
 * @since 2025-04-07
 */
@Table(value = "TC_ORDER", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class TcOrder extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 订单号
     */
    private String orderNumber;

    /**
     * 泊位号
     */
    private String berthNumber;

    /**
     * 收费点
     */
    private String pointCharge;

    /**
     * 驶入时间
     */
    private Date enterDate;

    /**
     * 驶离时间
     */
    private Date exitDate;

    /**
     * 停留时长
     */
    private String stayDate;

    /**
     * 车牌号
     */
    private String plateNumber;

    /**
     * 图片链接
     */
    private String pictureUrl;

    // 无参构造函数
    public TcOrder() {
    }

    // 全参构造函数
    public TcOrder(Long orderId, String orderNumber, String berthNumber, String pointCharge, 
                   Date enterDate, Date exitDate, String stayDate, String plateNumber, String pictureUrl) {
        this.orderId = orderId;
        this.orderNumber = orderNumber;
        this.berthNumber = berthNumber;
        this.pointCharge = pointCharge;
        this.enterDate = enterDate;
        this.exitDate = exitDate;
        this.stayDate = stayDate;
        this.plateNumber = plateNumber;
        this.pictureUrl = pictureUrl;
    }

    // Getter和Setter方法
    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getBerthNumber() {
        return berthNumber;
    }

    public void setBerthNumber(String berthNumber) {
        this.berthNumber = berthNumber;
    }

    public String getPointCharge() {
        return pointCharge;
    }

    public void setPointCharge(String pointCharge) {
        this.pointCharge = pointCharge;
    }

    public Date getEnterDate() {
        return enterDate;
    }

    public void setEnterDate(Date enterDate) {
        this.enterDate = enterDate;
    }

    public Date getExitDate() {
        return exitDate;
    }

    public void setExitDate(Date exitDate) {
        this.exitDate = exitDate;
    }

    public String getStayDate() {
        return stayDate;
    }

    public void setStayDate(String stayDate) {
        this.stayDate = stayDate;
    }

    public String getPlateNumber() {
        return plateNumber;
    }

    public void setPlateNumber(String plateNumber) {
        this.plateNumber = plateNumber;
    }

    public String getPictureUrl() {
        return pictureUrl;
    }

    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }

    // equals和hashCode方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        TcOrder tcOrder = (TcOrder) o;
        return Objects.equals(orderId, tcOrder.orderId) &&
               Objects.equals(orderNumber, tcOrder.orderNumber) &&
               Objects.equals(berthNumber, tcOrder.berthNumber) &&
               Objects.equals(pointCharge, tcOrder.pointCharge) &&
               Objects.equals(enterDate, tcOrder.enterDate) &&
               Objects.equals(exitDate, tcOrder.exitDate) &&
               Objects.equals(stayDate, tcOrder.stayDate) &&
               Objects.equals(plateNumber, tcOrder.plateNumber) &&
               Objects.equals(pictureUrl, tcOrder.pictureUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), orderId, orderNumber, berthNumber, pointCharge, 
                           enterDate, exitDate, stayDate, plateNumber, pictureUrl);
    }

    // Builder模式
    public static TcOrderBuilder builder() {
        return new TcOrderBuilder();
    }

    public static class TcOrderBuilder {
        private Long orderId;
        private String orderNumber;
        private String berthNumber;
        private String pointCharge;
        private Date enterDate;
        private Date exitDate;
        private String stayDate;
        private String plateNumber;
        private String pictureUrl;

        public TcOrderBuilder orderId(Long orderId) {
            this.orderId = orderId;
            return this;
        }

        public TcOrderBuilder orderNumber(String orderNumber) {
            this.orderNumber = orderNumber;
            return this;
        }

        public TcOrderBuilder berthNumber(String berthNumber) {
            this.berthNumber = berthNumber;
            return this;
        }

        public TcOrderBuilder pointCharge(String pointCharge) {
            this.pointCharge = pointCharge;
            return this;
        }

        public TcOrderBuilder enterDate(Date enterDate) {
            this.enterDate = enterDate;
            return this;
        }

        public TcOrderBuilder exitDate(Date exitDate) {
            this.exitDate = exitDate;
            return this;
        }

        public TcOrderBuilder stayDate(String stayDate) {
            this.stayDate = stayDate;
            return this;
        }

        public TcOrderBuilder plateNumber(String plateNumber) {
            this.plateNumber = plateNumber;
            return this;
        }

        public TcOrderBuilder pictureUrl(String pictureUrl) {
            this.pictureUrl = pictureUrl;
            return this;
        }

        public TcOrder build() {
            return new TcOrder(orderId, orderNumber, berthNumber, pointCharge, enterDate, 
                              exitDate, stayDate, plateNumber, pictureUrl);
        }
    }

}
